import request from './request';

/**
 * 获取答题结果列表
 * @param {Object} params 查询参数
 * @returns {Promise}
 */
export const getAnswerResultList = (params) => {
  return request({
    url: '/answerresult/answerresult/details',
    method: 'get',
    params: {
      ...params,
      del: 0 // 仅查询未删除记录
    }
  });
};

/**
 * 逻辑删除答题结果
 * @param {number} id 要删除的记录ID
 * @returns {Promise}
 */
export const logicalDeleteAnswerResult = (id) => {
  return request({
    url: '/answerresult/answerresult',
    method: 'put',
    data: {
      id: id,
      del: 1 // 设置删除标志为1
    }
  });
};

/**
 * 新增答题结果
 * @param {Object} data 新增的数据
 * @returns {Promise}
 */
export const insertAnswerResult = (data) => {
  return request({
    url: '/answerresult/answerresult',
    method: 'post',
    data
  });
};

